package com.zmc.member.controller;

import com.zmc.common.domain.query.user.MerchantAddressQuery;
import com.zmc.common.utils.R;
import com.zmc.member.infrastructure.bean.vo.AreaInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.zmc.member.infrastructure.service.AreaInfoService;



/**
 * 
 *
 * @author zmc
 * @email 
 * @date 2024-11-22 16:46:06
 */
@RestController
@RequestMapping("/area")
public class AreaInfoController {


    @Autowired
    private AreaInfoService areaInfoService;

    /**
     * 通过code查询下级地区列表
     * */
    @PostMapping("/info")
    public R info(@RequestBody AreaInfoVo vo){
        return R.ok(areaInfoService.getChildrenByParentCode(vo.getParentCode()));
    }

    /**
     *  商户认证授权补全地址
     * */
    @PostMapping("/detail")
    public R areaDetail(@RequestBody MerchantAddressQuery query){
        return R.ok(areaInfoService.getListByCodes(query.getAddress()));
    }



}
